package com.example.demo.mapper;

import com.example.demo.po.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

@Component
@Mapper
public interface MyMapper {


    @Select("select password from user where username=#{username}")
    String getPassword(User user);

    @Insert("insert into user(username,password) values(#{username},#{password})")
    int Register(User user);

    @Select("select * from user where username=#{username}")
    User getUser(String username);
}
